<script setup lang="ts">
import { defineProps } from 'vue';
import {img, redirect} from '@/utils/common';
const props = defineProps(['item', 'type']);
</script>
<template>
	<view class="min-h-[270rpx] bg-[#fff] my-[20rpx] rounded-[20rpx] p-[24rpx] box-border relative">
		<view class="text-[rgb(74,74,74)] mb-[10rpx]" v-if="type !== 'shop'">订单号：{{ item.order_no }}</view>
		<view class="flex items-center relative z-1">
			<view class="w-[150rpx] h-[150rpx] mr-[20rpx]"><image :src="img(item.goods_image)" class="w-full h-full object-cover" /></view>
			<view class="w-[calc(100%-178rpx)] text-[24rpx] text-[rgb(153,153,153)] leading-[40rpx]">
				<view class="text-[28rpx] text-[#000] leading-[56rpx]">{{ item.goods_name }}</view>
				<view>门店：{{ item.store_name }}</view>
				<view>设备ID：{{ item.device_no }}</view>
				<view v-if="type !== 'shop'">租期：{{ item.lease_time }}</view>
			</view>
			<view class="text-[#FF0000] text-[32rpx] absolute z-2 right-0 top-[calc(50%-18rpx)]" v-if="type !== 'index'">￥0.00</view>
		</view>
		<template v-if="type === 'shop'">
			<view class="h-[0.5px] bg-[#D8D8D8] my-[36rpx]"></view>
			<view class="flex justify-between items-center text-[24rpx]">
				<view class="flex items-center">
					<u-image :src="img('/upload/dyj/static/useIcon.png')" width="36rpx" height="36rpx" mode="aspectFill" class="mr-[20rpx]" />
					上月使用
					<text class="text-[28rpx] text-[#9A7A4B] mx-[4rpx]">0</text>
					个耗材
				</view>
				<view class="flex items-center">
					<u-image :src="img('/upload/dyj/static/useIcon.png')" width="36rpx" height="36rpx" mode="aspectFill" class="mr-[20rpx]" />
					上月使用
					<text class="text-[28rpx] text-[#9A7A4B] mx-[4rpx]">0</text>
					个耗材
				</view>
			</view>
		</template>
		<view
			v-if="type !== 'bill'"
			class="w-[128rpx] h-[50rpx] absolute z-10 right-0 top-0 text-[12px] text-center leading-[50rpx] rounded-bl-[20rpx] rounded-tr-[20rpx] bg-[#9A7A4B] text-[#fff]"
			@click="type !== 'shop' ? redirect({ url: '/app/pages/rent/shopDetail', param: { id: item.store_id } }) : null"
		>
			{{ item.rent_status }}
		</view>
	</view>
</template>

<style lang="scss" scoped></style>
<style lang="scss"></style>
